<?php
/**
 * logs_list.inc
 * Template: View a list log entries.
 * @copyright	Copyright(c) 2002-2010 Bjorn Winberg
 * @author		Bjorn Winberg <cms@anomalye.net>
 * @license		http://www.gnu.org/licenses/gpl.html GNU General Public License version 2
 * @package		AnomalyWiki
 */
	//echo system_applyTemplate('system_admin.inc');
	$this->mSystem->mHtmlHeaders[] = '<link type="text/css" href="' . $this->getSkinUrl('logs_list.css') . '" rel="stylesheet" />';
?>

<h1><?php echo $this->localString('L_TITLE');?></h1>
<div class='subMenu'>
<?php
	echo '<ul>';
	echo '<li><a href="' . $this->generateUrl('logs') . '">' . $this->localString('L_ALL') . '</a></li>';
	foreach($aParams['modules'] as $module => $moduleName){
		$moduleName = $moduleName != ''? $moduleName: $module;
		echo '<li><a href="' . $this->generateUrl('logs', array('module' => $module)) . '">' . $this->getSafeStr($moduleName) . '</a></li>';
	}
	echo '</ul>';
?>
</div>

<div class="helpBox">
	<?php echo $this->localString('L_HELP');?>
</div>

<div class="section">
<?php
	echo '<div class="sectionHeader">' . $this->localString('L_HEADER') . '</div>';
	$style = false;
	foreach($aParams['list'] as $item){ 
		$style = $style == 'sectionRow1'? 'sectionRow2': 'sectionRow1';
		echo '<div class="' . $style . '">';
		echo '<div class="logsCol logsColTime">'. $this->generateTimeScript($item['time']) . '</div>';
		echo '<div class="logsCol logsColModule">'. $this->getSafeStr($item['module']) . '</div>';
		echo '<div class="logsCol logsColUser">'. $this->getSafeStr($item['user_name']) . '</div>';
		echo '<div class="logsCol logsColMessage">'. $item['message'] . '</div>';
		echo '</div>';
	}
	if(count($aParams['list']) == 0){
		echo $this->localString('L_NOITEMS');
	}
	else{
		echo $this->pagingGenerateFooter($aParams['logsPrev'], $aParams['logsNext']);
	}
?>
</div>

